package org.jsola.hr.web;

import io.swagger.annotations.Api;
import io.swagger.annotations.ApiImplicitParam;
import io.swagger.annotations.ApiImplicitParams;
import io.swagger.annotations.ApiOperation;
import org.jsola.core.Page;
import org.jsola.core.Result;
import org.jsola.hr.dto.InstitutionAddDTO;
import org.jsola.hr.dto.InstitutionOpenDTO;
import org.jsola.hr.dto.InstitutionUpdateDTO;
import org.jsola.hr.query.InstitutionQuery;
import org.jsola.hr.vo.InstitutionListVO;
import org.jsola.hr.vo.InstitutionVO;

import java.util.List;

/**
 * 制度
 *
 * @author zhr
 */
@Api(tags = "hr-制度")
public interface IInstitutionControllerAPI {

    /**
     * 新增制度
     *
     * @param institutionAddDTO 制度新增实体
     * @return 制度展示对象
     */
    @ApiOperation(value = "新增制度")
    @ApiImplicitParams({
            @ApiImplicitParam(name = "institutionAddDTO", dataType = "InstitutionAddDTO", value = "新增制度", paramType = "body")
    })
    Result<InstitutionVO> save(InstitutionAddDTO institutionAddDTO);


    /**
     * 修改制度
     *
     * @param institutionUpdateDTO 制度
     * @return 更新数量
     */
    @ApiOperation(value = "修改制度")
    @ApiImplicitParams({
            @ApiImplicitParam(name = "institutionUpdateDTO", dataType = "InstitutionUpdateDTO", value = "修改制度", paramType = "body")
    })
    Result<Integer> update(InstitutionUpdateDTO institutionUpdateDTO);

    /**
     * 开启制度
     *
     * @param institutionOpenDTO 制度信息
     * @return 更新数量
     */
    @ApiOperation(value = "开启制度")
    @ApiImplicitParams({
            @ApiImplicitParam(name = "institutionOpenDTO", dataType = "InstitutionOpenDTO", value = "制度id", paramType = "body")
    })
    Result<Integer> openInstitution(InstitutionOpenDTO institutionOpenDTO);

    /**
     * 关闭制度
     *
     * @param InstitutionOpenDTO 制度信息
     * @return 更新数量
     */
    @ApiOperation(value = "开启制度")
    @ApiImplicitParams({
            @ApiImplicitParam(name = "InstitutionOpenDTO", dataType = "InstitutionOpenDTO", value = "制度id", paramType = "body")
    })
    Result<Integer> closeInstitution(InstitutionOpenDTO InstitutionOpenDTO);


    /**
     * 删除单个制度，彻底删除
     *
     * @param institutionId 制度id
     * @return 删除数量
     */
    @ApiOperation(value = "删除单个制度，彻底删除")
    @ApiImplicitParams({
            @ApiImplicitParam(name = "institutionId", dataType = "String", value = "制度id", paramType = "path")
    })
    Result<Integer> delete(String institutionId);


    /**
     * 批量删除制度，彻底删除
     *
     * @param institutionIds 制度id集合
     * @return 删除数量
     */
    @ApiOperation(value = "批量删除制度，彻底删除")
    @ApiImplicitParams({
            @ApiImplicitParam(name = "institutionIds", dataType = "String[]", value = "制度id数组", paramType = "body", allowMultiple = true)
    })
    Result<Integer> deleteBatch(String[] institutionIds);


    /**
     * 根据制度id查询制度详情
     *
     * @param institutionId 制度id
     * @return 制度详情
     */
    @ApiOperation(value = "根据制度id查询制度详情")
    @ApiImplicitParams({
            @ApiImplicitParam(name = "institutionId", dataType = "String", value = "制度id", paramType = "path")
    })
    Result<InstitutionVO> findById(String institutionId);


    /**
     * 查询制度
     *
     * @param institutionQuery 制度查询参数
     * @return page
     */
    @ApiOperation(value = "查询制度")
    @ApiImplicitParams({
            @ApiImplicitParam(name = "institutionQuery", dataType = "InstitutionQuery", value = "制度查询参数", paramType = "query")
    })
    Result<List<InstitutionListVO>> listAll(InstitutionQuery institutionQuery);


    /**
     * 分页查询制度
     *
     * @param institutionQuery 制度查询参数
     * @return page
     */
    @ApiOperation(value = "分页查询制度")
    @ApiImplicitParams({
            @ApiImplicitParam(name = "institutionQuery", dataType = "InstitutionQuery", value = "制度查询参数", paramType = "query")
    })
    Result<Page<InstitutionListVO>> page(InstitutionQuery institutionQuery);


    /**
     * 查询制度分类下用工单位中制度
     *
     * @param institutionTypeId 制度分类id
     * @param pageNo
     * @param pageSize
     * @return 制度列表
     */
    Result<Page<InstitutionListVO>> selectByTypeIdAndCompanyId(String institutionTypeId, String companyId
            , Integer pageNo, Integer pageSize);


    /**
     * 查询用工单位开启的制度 员工端小程序使用
     *
     * @return 制度列表
     */
    Result<List<InstitutionListVO>> selectOpenByCompanyId(String companyId);
}

